﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;


namespace winform_用户界面客户端
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            main_Form = new MainForm();
            db_Manager = new DB_Manager();
            map_Editor = new Map_Editor();
            
            if (args.Length != 0)
            {//！：这里应该是 让db_Mananger自己具备一个public函数，供外界调用。
                db_Manager.Root_Path.Text = args[0];                 
                db_Manager.MyOutPut("收到参数:" + args[0]);
                db_Manager.button1_Click(null, null);
            }

            Application.Run(db_Manager);
            
            
        }

        public static MainForm main_Form;
        public static DB_Manager db_Manager;
        public static Map_Editor map_Editor;

        public static void ShowWindow( Form formObject)
        {
            if (formObject.IsDisposed ==true)
            {
                if (formObject.Equals(map_Editor))
                {
                    formObject = new Map_Editor();
                }
                else if (formObject.Equals(db_Manager))
                {
                    formObject = new DB_Manager();
                }
            }
            formObject.Show();
        }
    }
}
